package com.pine.app.module.security.oauth.support.client;

import com.pine.app.module.security.oauth.support.AbstractHttpTokenRequest;
import com.pine.app.module.security.oauth.support.ClientCredentials;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Set;


/**
 * @author xiaoyuan
 * @create 2019/9/30 14:21
 **/
public class HttpClientCredentialRequest extends AbstractHttpTokenRequest implements ClientCredentialRequest {

    public HttpClientCredentialRequest(HttpServletRequest request) {
        super(request);
    }

    public HttpClientCredentialRequest(Map<String, String> parameters, Map<String, String> headers, Set<String> scope, String grantType, ClientCredentials clientCredentials) {
        super(parameters, headers, scope, grantType, clientCredentials);
    }

    @Override
    public String getClientId() {
        return this.clientCredentials.getPrincipal();
    }

    @Override
    public String getClientSecret() {
        return this.clientCredentials.getCredentials();
    }

    @Override
    public  boolean enableRefresh() {
        return false;
    }
}
